package com.xinzhi.utils;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class MD5Utils {

    public static String encrypt(String password){
        MessageDigest md = null;
        String s = null;
        try {
            md = MessageDigest.getInstance("MD5");
            md.update(password.getBytes());
            s = new BigInteger(1, md.digest()).toString(16);
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return s;
    }
}
